<?php
/**
 * Created by PhpStorm.
 * User: stupboy
 * Date: 2018/4/21
 * Time: 21:34
 * Mail:87658989@qq.com
 */

namespace app\cron\controller;

use app\base\service\Redis;
use app\base\logic\Sms as SmsLogic;
class Sms
{
    /**
     * 队列发送阿里云短信 5S
     */
    public function sendDayu(){
        $redis  = Redis::getInstance();
        $sms    = new SmsLogic();
        $key    = 'send_sms_list';
        do{
            $ret  = $redis->pop($key);
            $data = unserialize($ret);
            $sms->sendTemplate($data['mobile'],$data['data'],$data['code'],$data['server']);
        }while($redis->lLen($key));
    }
}